SERVER_NAME=user
SERVER_TYPE=rpc

# dev版本
VERSION=latest
VERSION_DEV=$(VERSION)

# 编译后的程序名称
APP_NAME_DEV=im-${SERVER_NAME}-${SERVER_TYPE}-dev

# dev环境下依托的dockerfile文件
DOCKER_FILE_DEV=./deploy/dockerfile/Dockerfile_${SERVER_NAME}_${SERVER_TYPE}_dev

# dev环境下的编译发布
build-test:
	# 将程序编译为二进制可执行文件
	GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/${SERVER_NAME}-${SERVER_TYPE} ./apps/${SERVER_NAME}/${SERVER_TYPE}/${SERVER_NAME}.go

	# 根据二进制文件构建成镜像文件
	docker build . -f ${DOCKER_FILE_DEV} --no-cache -t ${APP_NAME_DEV}:${VERSION_DEV}

## 镜像的标签
#tag-test:
#	@echo 'create tag ${VERSION_DEV}'
#	docker tag ${APP_NAME_DEV} ${APP_NAME_DEV}:${VERSION_DEV}

release-test: build-test